package cn.micro.keep.accounts.mybatis;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import java.util.List;

public class BasicServiceImpl<M extends IBasicMapper<T>, T> extends ServiceImpl<M, T> implements IBasicService<T> {

    @Override
    public int insertBatch(List<T> list) {
        if(list==null || list.size()<1){
            return 0;
        }
        return baseMapper.insertBatch(list);
    }

    @Override
    public int updateBatch(List<T> list) {
        return baseMapper.updateBatch(list);
    }

    @Override
    public int insert(T data) {
        return baseMapper.insert(data);
    }

    @Override
    public int updateInfoById(T data) {
        return baseMapper.updateById(data);
    }

    @Override
    public int deleteById(T id) {
        return baseMapper.deleteById(id);
    }

    @Override
    public int deleteByCondition(QueryWrapper<T> queryWrapper) {
        return baseMapper.delete(queryWrapper);
    }


}